<script setup lang="ts">
definePage({
  style: {
    // 'custom' 表示开启自定义导航栏，默认 'default'
    navigationStyle: 'custom',
    navigationBarTitleText: '首页',
    usingComponents: {
      'xr-ar-basic': '../../wxcomponents/xr-ar-basic',
    },
  },
})

const width = ref(300)
const height = ref(300)
const renderWidth = ref(300)
const renderHeight = ref(300)

onLoad(() => {
  width.value = uni.getWindowInfo().windowWidth
  height.value = uni.getWindowInfo().windowHeight
  const dpi = uni.getWindowInfo().pixelRatio
  renderWidth.value = width.value * dpi
  renderHeight.value = height.value * dpi
})
</script>

<template>
  <view class="content">
    <xr-ar-basic :width="renderWidth" :height="renderHeight" :style="`width:${width}px;height:${height}px;`" />
  </view>
</template>

<style scoped lang="scss">

</style>
